const { Schema, model } = require("mongoose");
const testsSchema = new Schema(
  {
    title: String, // 试卷标题
    date: String, // 考试时间
    time: String, // 答题时长
    typeId: {
      type: Schema.Types.ObjectId,
      ref: "typesModel"
    },
    exercisesId: [
      // 当前试卷关联的所有题目 _id
      {
        type: Schema.Types.ObjectId,
        ref: "exercisesModel"
      }
    ]
  },
  { versionKey: false }
);
// 配置数据模型
const testsModel = model("testsModel", testsSchema, "tests");
//module.exports.classesModel = classesModel;
module.exports = {
  testsModel
};
